home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 242 / Issue 242 - April 2008 - DPCS0408DVD.ISO / Software Money Savers / VirtualDub / Source / VirtualDub-1.7.7-src.7z / src / Kasumi / source / blt_x86.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2006-03-14  |  36.5 KB  |  466 lines

  1. #include <vd2/system/vdtypes.h>
  2. #include <vd2/Kasumi/pixmap.h>
  3. #include <vd2/Kasumi/pixmaputils.h>
  4.  
  5. #define DECLARE_PALETTED(x, y) extern void VDPixmapBlt_##x##_to_##y##_reference(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h, const void *pal0);
  6. #define DECLARE_RGB(x, y) extern void VDPixmapBlt_##x##_to_##y##_reference(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h);
  7. #define DECLARE_RGB_ASM(x, y) extern "C" void vdasm_pixblt_##x##_to_##y(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h);
  8. #define DECLARE_RGB_ASM_MMX(x, y) extern "C" void vdasm_pixblt_##x##_to_##y##_MMX(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h);
  9. #define DECLARE_YUV(x, y) extern void VDPixmapBlt_##x##_to_##y##_reference(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h);
  10. #define DECLARE_YUV_REV(x, y) void VDPixmapBlt_##x##_to_##y##_reference(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, vdpixsize w, vdpixsize h)
  11. #define DECLARE_YUV_PLANAR(x, y) extern void VDPixmapBlt_##x##_to_##y##_reference(const VDPixmap& dst, const VDPixmap& src, vdpixsize w, vdpixsize h);
  12.  
  13.                                     DECLARE_RGB_ASM(RGB565,      XRGB1555);    DECLARE_RGB_ASM_MMX(RGB565,   XRGB1555);
  14.                                     DECLARE_RGB_ASM(RGB888,   XRGB1555);
  15.                                     DECLARE_RGB_ASM(XRGB8888, XRGB1555);    DECLARE_RGB_ASM_MMX(XRGB8888, XRGB1555);
  16.                                     DECLARE_RGB_ASM(XRGB1555, RGB565);        DECLARE_RGB_ASM_MMX(XRGB1555, RGB565);
  17.                                     DECLARE_RGB_ASM(RGB888,   RGB565);
  18.                                     DECLARE_RGB_ASM(XRGB8888, RGB565);        DECLARE_RGB_ASM_MMX(XRGB8888, RGB565);
  19. DECLARE_RGB(XRGB1555, RGB888);
  20. DECLARE_RGB(RGB565,   RGB888);
  21.                                     DECLARE_RGB_ASM(XRGB8888, RGB888);        DECLARE_RGB_ASM_MMX(XRGB8888, RGB888);
  22.                                     DECLARE_RGB_ASM(XRGB1555, XRGB8888);    DECLARE_RGB_ASM_MMX(XRGB1555, XRGB8888);
  23.                                     DECLARE_RGB_ASM(RGB565,   XRGB8888);    DECLARE_RGB_ASM_MMX(RGB565,   XRGB8888);
  24.                                     DECLARE_RGB_ASM(RGB888,   XRGB8888);    DECLARE_RGB_ASM_MMX(RGB888,   XRGB8888);
  25.  
  26. DECLARE_PALETTED(Pal1, Any8);
  27. DECLARE_PALETTED(Pal1, Any16);
  28. DECLARE_PALETTED(Pal1, Any24);
  29. DECLARE_PALETTED(Pal1, Any32);
  30. DECLARE_PALETTED(Pal2, Any8);
  31. DECLARE_PALETTED(Pal2, Any16);
  32. DECLARE_PALETTED(Pal2, Any24);
  33. DECLARE_PALETTED(Pal2, Any32);
  34. DECLARE_PALETTED(Pal4, Any8);
  35. DECLARE_PALETTED(Pal4, Any16);
  36. DECLARE_PALETTED(Pal4, Any24);
  37. DECLARE_PALETTED(Pal4, Any32);
  38. DECLARE_PALETTED(Pal8, Any8);
  39. DECLARE_PALETTED(Pal8, Any16);
  40. DECLARE_PALETTED(Pal8, Any24);
  41. DECLARE_PALETTED(Pal8, Any32);
  42.  
  43. DECLARE_YUV(XVYU, UYVY);
  44. DECLARE_YUV(XVYU, YUYV);
  45. DECLARE_YUV(Y8, UYVY);
  46. DECLARE_YUV(Y8, YUYV);
  47. DECLARE_YUV(UYVY, Y8);
  48. DECLARE_YUV(YUYV, Y8);
  49. DECLARE_YUV(UYVY, YUYV);
  50. DECLARE_YUV_PLANAR(YUV411, YV12);
  51.  
  52. DECLARE_YUV(UYVY, XRGB1555);
  53. DECLARE_YUV(UYVY, RGB565);
  54. DECLARE_YUV(UYVY, RGB888);
  55. DECLARE_YUV(UYVY, XRGB8888);
  56. DECLARE_YUV(YUYV, XRGB1555);
  57. DECLARE_YUV(YUYV, RGB565);
  58. DECLARE_YUV(YUYV, RGB888);
  59. DECLARE_YUV(YUYV, XRGB8888);
  60. DECLARE_YUV(Y8, XRGB1555);
  61. DECLARE_YUV(Y8, RGB565);
  62. DECLARE_YUV(Y8, RGB888);
  63. DECLARE_YUV(Y8, XRGB8888);
  64.  
  65. DECLARE_YUV_REV(XRGB1555, Y8);
  66. DECLARE_YUV_REV(RGB565,   Y8);
  67. DECLARE_YUV_REV(RGB888,   Y8);
  68. DECLARE_YUV_REV(XRGB8888, Y8);
  69.  
  70. DECLARE_YUV_REV(XRGB1555, XVYU);
  71. DECLARE_YUV_REV(RGB565,   XVYU);
  72. DECLARE_YUV_REV(RGB888,   XVYU);
  73. DECLARE_YUV_REV(XRGB8888, XVYU);
  74.  
  75. DECLARE_YUV_PLANAR(YV12, XRGB1555);
  76. DECLARE_YUV_PLANAR(YV12, RGB565);
  77. DECLARE_YUV_PLANAR(YV12, RGB888);
  78. DECLARE_YUV_PLANAR(YV12, XRGB8888);
  79.  
  80. DECLARE_YUV_PLANAR(YUV411, XRGB1555);
  81. DECLARE_YUV_PLANAR(YUV411, RGB565);
  82. DECLARE_YUV_PLANAR(YUV411, RGB888);
  83. DECLARE_YUV_PLANAR(YUV411, XRGB8888);
  84.  
  85. extern void VDPixmapBlt_YUVPlanar_decode_reference(const VDPixmap& dst, const VDPixmap& src, vdpixsize w, vdpixsize h);
  86. extern void VDPixmapBlt_YUVPlanar_encode_reference(const VDPixmap& dst, const VDPixmap& src, vdpixsize w, vdpixsize h);
  87. extern void VDPixmapBlt_YUVPlanar_convert_reference(const VDPixmap& dst, const VDPixmap& src, vdpixsize w, vdpixsize h);
  88.  
  89. using namespace nsVDPixmap;
  90.  
  91. tpVDPixBltTable VDGetPixBltTableX86Scalar() {
  92.     static void *sReferenceMap[kPixFormat_Max_Standard][kPixFormat_Max_Standard] = {0};
  93.  
  94.     sReferenceMap[kPixFormat_Pal1][kPixFormat_Y8      ] = VDPixmapBlt_Pal1_to_Any8_reference;
  95.     sReferenceMap[kPixFormat_Pal1][kPixFormat_XRGB1555] = VDPixmapBlt_Pal1_to_Any16_reference;
  96.     sReferenceMap[kPixFormat_Pal1][kPixFormat_RGB565  ] = VDPixmapBlt_Pal1_to_Any16_reference;
  97.     sReferenceMap[kPixFormat_Pal1][kPixFormat_RGB888  ] = VDPixmapBlt_Pal1_to_Any24_reference;
  98.     sReferenceMap[kPixFormat_Pal1][kPixFormat_XRGB8888] = VDPixmapBlt_Pal1_to_Any32_reference;
  99.     sReferenceMap[kPixFormat_Pal2][kPixFormat_Y8      ] = VDPixmapBlt_Pal2_to_Any8_reference;
  100.     sReferenceMap[kPixFormat_Pal2][kPixFormat_XRGB1555] = VDPixmapBlt_Pal2_to_Any16_reference;
  101.     sReferenceMap[kPixFormat_Pal2][kPixFormat_RGB565  ] = VDPixmapBlt_Pal2_to_Any16_reference;
  102.     sReferenceMap[kPixFormat_Pal2][kPixFormat_RGB888  ] = VDPixmapBlt_Pal2_to_Any24_reference;
  103.     sReferenceMap[kPixFormat_Pal2][kPixFormat_XRGB8888] = VDPixmapBlt_Pal2_to_Any32_reference;
  104.     sReferenceMap[kPixFormat_Pal4][kPixFormat_Y8      ] = VDPixmapBlt_Pal4_to_Any8_reference;
  105.     sReferenceMap[kPixFormat_Pal4][kPixFormat_XRGB1555] = VDPixmapBlt_Pal4_to_Any16_reference;
  106.     sReferenceMap[kPixFormat_Pal4][kPixFormat_RGB565  ] = VDPixmapBlt_Pal4_to_Any16_reference;
  107.     sReferenceMap[kPixFormat_Pal4][kPixFormat_RGB888  ] = VDPixmapBlt_Pal4_to_Any24_reference;
  108.     sReferenceMap[kPixFormat_Pal4][kPixFormat_XRGB8888] = VDPixmapBlt_Pal4_to_Any32_reference;
  109.     sReferenceMap[kPixFormat_Pal8][kPixFormat_Y8      ] = VDPixmapBlt_Pal8_to_Any8_reference;
  110.     sReferenceMap[kPixFormat_Pal8][kPixFormat_XRGB1555] = VDPixmapBlt_Pal8_to_Any16_reference;
  111.     sReferenceMap[kPixFormat_Pal8][kPixFormat_RGB565  ] = VDPixmapBlt_Pal8_to_Any16_reference;
  112.     sReferenceMap[kPixFormat_Pal8][kPixFormat_RGB888  ] = VDPixmapBlt_Pal8_to_Any24_reference;
  113.     sReferenceMap[kPixFormat_Pal8][kPixFormat_XRGB8888] = VDPixmapBlt_Pal8_to_Any32_reference;
  114.  
  115.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_RGB565  ] = vdasm_pixblt_XRGB1555_to_RGB565;
  116.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_RGB888  ] = VDPixmapBlt_XRGB1555_to_RGB888_reference;
  117.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_XRGB8888] = vdasm_pixblt_XRGB1555_to_XRGB8888;
  118.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_XRGB1555] = vdasm_pixblt_RGB565_to_XRGB1555;
  119.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_RGB888  ] = VDPixmapBlt_RGB565_to_RGB888_reference;
  120.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_XRGB8888] = vdasm_pixblt_RGB565_to_XRGB8888;
  121.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_XRGB1555] = vdasm_pixblt_RGB888_to_XRGB1555;
  122.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_RGB565  ] = vdasm_pixblt_RGB888_to_RGB565;
  123.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_XRGB8888] = vdasm_pixblt_RGB888_to_XRGB8888;
  124.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_XRGB1555] = vdasm_pixblt_XRGB8888_to_XRGB1555;
  125.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_RGB565  ] = vdasm_pixblt_XRGB8888_to_RGB565;
  126.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_RGB888  ] = vdasm_pixblt_XRGB8888_to_RGB888;
  127.  
  128.     sReferenceMap[kPixFormat_YUV444_XVYU][kPixFormat_YUV422_UYVY] = VDPixmapBlt_XVYU_to_UYVY_reference;
  129.     sReferenceMap[kPixFormat_YUV444_XVYU][kPixFormat_YUV422_YUYV] = VDPixmapBlt_XVYU_to_YUYV_reference;
  130.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_UYVY] = VDPixmapBlt_Y8_to_UYVY_reference;
  131.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_YUYV] = VDPixmapBlt_Y8_to_YUYV_reference;
  132.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_Y8] = VDPixmapBlt_UYVY_to_Y8_reference;
  133.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_Y8] = VDPixmapBlt_YUYV_to_Y8_reference;
  134.  
  135.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_XRGB1555] = VDPixmapBlt_UYVY_to_XRGB1555_reference;
  136.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_RGB565  ] = VDPixmapBlt_UYVY_to_RGB565_reference;
  137.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_RGB888  ] = VDPixmapBlt_UYVY_to_RGB888_reference;
  138.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_XRGB8888] = VDPixmapBlt_UYVY_to_XRGB8888_reference;
  139.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_XRGB1555] = VDPixmapBlt_YUYV_to_XRGB1555_reference;
  140.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_RGB565  ] = VDPixmapBlt_YUYV_to_RGB565_reference;
  141.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_RGB888  ] = VDPixmapBlt_YUYV_to_RGB888_reference;
  142.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_XRGB8888] = VDPixmapBlt_YUYV_to_XRGB8888_reference;
  143.     sReferenceMap[kPixFormat_Y8][kPixFormat_XRGB1555] = VDPixmapBlt_Y8_to_XRGB1555_reference;
  144.     sReferenceMap[kPixFormat_Y8][kPixFormat_RGB565  ] = VDPixmapBlt_Y8_to_RGB565_reference;
  145.     sReferenceMap[kPixFormat_Y8][kPixFormat_RGB888  ] = VDPixmapBlt_Y8_to_RGB888_reference;
  146.     sReferenceMap[kPixFormat_Y8][kPixFormat_XRGB8888] = VDPixmapBlt_Y8_to_XRGB8888_reference;
  147.  
  148.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV444_XVYU] = VDPixmapBlt_XRGB1555_to_XVYU_reference;
  149.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV444_XVYU] = VDPixmapBlt_RGB565_to_XVYU_reference;
  150.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV444_XVYU] = VDPixmapBlt_RGB888_to_XVYU_reference;
  151.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV444_XVYU] = VDPixmapBlt_XRGB8888_to_XVYU_reference;
  152.  
  153.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_Y8] = VDPixmapBlt_XRGB1555_to_Y8_reference;
  154.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_Y8] = VDPixmapBlt_RGB565_to_Y8_reference;
  155.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_Y8] = VDPixmapBlt_RGB888_to_Y8_reference;
  156.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_Y8] = VDPixmapBlt_XRGB8888_to_Y8_reference;
  157.  
  158. #if 0
  159.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YV12_to_XRGB1555_reference;
  160.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YV12_to_RGB565_reference;
  161.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YV12_to_RGB888_reference;
  162.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YV12_to_XRGB8888_reference;
  163.  
  164.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUV411_to_XRGB1555_reference;
  165.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUV411_to_RGB565_reference;
  166.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUV411_to_RGB888_reference;
  167.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUV411_to_XRGB8888_reference;
  168. #else
  169.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  170.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  171.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  172.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  173.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  174.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  175.  
  176.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  177.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  178.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  179.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  180.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  181.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  182.  
  183.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  184.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  185.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  186.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  187.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  188.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  189.  
  190.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  191.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  192.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  193.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  194.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  195.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  196.  
  197.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  198.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  199.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  200.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  201.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  202.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  203. #endif
  204.  
  205.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUV411_to_YV12_reference;
  206.  
  207.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV422_YUYV] = VDPixmapBlt_UYVY_to_YUYV_reference;
  208.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV422_UYVY] = VDPixmapBlt_UYVY_to_YUYV_reference;        // not an error -- same routine
  209.  
  210.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  211.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  212.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  213.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  214.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  215.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  216.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  217.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  218.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  219.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  220.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  221.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  222.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  223.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  224.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  225.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  226.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  227.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  228.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  229.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  230.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  231.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  232.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  233.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  234.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  235.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  236.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  237.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  238.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  239.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  240.  
  241.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  242.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  243.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  244.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  245.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  246.  
  247.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  248.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  249.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  250.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  251.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  252.  
  253.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  254.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  255.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  256.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  257.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  258.  
  259.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  260.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  261.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  262.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  263.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  264.  
  265.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  266.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  267.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  268.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  269.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  270.  
  271.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  272.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  273.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  274.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  275.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  276.  
  277.     return sReferenceMap;
  278. }
  279.  
  280. tpVDPixBltTable VDGetPixBltTableX86MMX() {
  281.     static void *sReferenceMap[kPixFormat_Max_Standard][kPixFormat_Max_Standard] = {0};
  282.  
  283.     sReferenceMap[kPixFormat_Pal1][kPixFormat_Y8      ] = VDPixmapBlt_Pal1_to_Any8_reference;
  284.     sReferenceMap[kPixFormat_Pal1][kPixFormat_XRGB1555] = VDPixmapBlt_Pal1_to_Any16_reference;
  285.     sReferenceMap[kPixFormat_Pal1][kPixFormat_RGB565  ] = VDPixmapBlt_Pal1_to_Any16_reference;
  286.     sReferenceMap[kPixFormat_Pal1][kPixFormat_RGB888  ] = VDPixmapBlt_Pal1_to_Any24_reference;
  287.     sReferenceMap[kPixFormat_Pal1][kPixFormat_XRGB8888] = VDPixmapBlt_Pal1_to_Any32_reference;
  288.     sReferenceMap[kPixFormat_Pal2][kPixFormat_Y8      ] = VDPixmapBlt_Pal2_to_Any8_reference;
  289.     sReferenceMap[kPixFormat_Pal2][kPixFormat_XRGB1555] = VDPixmapBlt_Pal2_to_Any16_reference;
  290.     sReferenceMap[kPixFormat_Pal2][kPixFormat_RGB565  ] = VDPixmapBlt_Pal2_to_Any16_reference;
  291.     sReferenceMap[kPixFormat_Pal2][kPixFormat_RGB888  ] = VDPixmapBlt_Pal2_to_Any24_reference;
  292.     sReferenceMap[kPixFormat_Pal2][kPixFormat_XRGB8888] = VDPixmapBlt_Pal2_to_Any32_reference;
  293.     sReferenceMap[kPixFormat_Pal4][kPixFormat_Y8      ] = VDPixmapBlt_Pal4_to_Any8_reference;
  294.     sReferenceMap[kPixFormat_Pal4][kPixFormat_XRGB1555] = VDPixmapBlt_Pal4_to_Any16_reference;
  295.     sReferenceMap[kPixFormat_Pal4][kPixFormat_RGB565  ] = VDPixmapBlt_Pal4_to_Any16_reference;
  296.     sReferenceMap[kPixFormat_Pal4][kPixFormat_RGB888  ] = VDPixmapBlt_Pal4_to_Any24_reference;
  297.     sReferenceMap[kPixFormat_Pal4][kPixFormat_XRGB8888] = VDPixmapBlt_Pal4_to_Any32_reference;
  298.     sReferenceMap[kPixFormat_Pal8][kPixFormat_Y8      ] = VDPixmapBlt_Pal8_to_Any8_reference;
  299.     sReferenceMap[kPixFormat_Pal8][kPixFormat_XRGB1555] = VDPixmapBlt_Pal8_to_Any16_reference;
  300.     sReferenceMap[kPixFormat_Pal8][kPixFormat_RGB565  ] = VDPixmapBlt_Pal8_to_Any16_reference;
  301.     sReferenceMap[kPixFormat_Pal8][kPixFormat_RGB888  ] = VDPixmapBlt_Pal8_to_Any24_reference;
  302.     sReferenceMap[kPixFormat_Pal8][kPixFormat_XRGB8888] = VDPixmapBlt_Pal8_to_Any32_reference;
  303.  
  304.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_RGB565  ] = vdasm_pixblt_XRGB1555_to_RGB565_MMX;
  305.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_RGB888  ] = VDPixmapBlt_XRGB1555_to_RGB888_reference;
  306.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_XRGB8888] = vdasm_pixblt_XRGB1555_to_XRGB8888_MMX;
  307.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_XRGB1555] = vdasm_pixblt_RGB565_to_XRGB1555_MMX;
  308.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_RGB888  ] = VDPixmapBlt_RGB565_to_RGB888_reference;
  309.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_XRGB8888] = vdasm_pixblt_RGB565_to_XRGB8888_MMX;
  310.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_XRGB1555] = vdasm_pixblt_RGB888_to_XRGB1555;
  311.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_RGB565  ] = vdasm_pixblt_RGB888_to_RGB565;
  312.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_XRGB8888] = vdasm_pixblt_RGB888_to_XRGB8888_MMX;
  313.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_XRGB1555] = vdasm_pixblt_XRGB8888_to_XRGB1555_MMX;
  314.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_RGB565  ] = vdasm_pixblt_XRGB8888_to_RGB565_MMX;
  315.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_RGB888  ] = vdasm_pixblt_XRGB8888_to_RGB888_MMX;
  316.  
  317.     sReferenceMap[kPixFormat_YUV444_XVYU][kPixFormat_YUV422_UYVY] = VDPixmapBlt_XVYU_to_UYVY_reference;
  318.     sReferenceMap[kPixFormat_YUV444_XVYU][kPixFormat_YUV422_YUYV] = VDPixmapBlt_XVYU_to_YUYV_reference;
  319.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_UYVY] = VDPixmapBlt_Y8_to_UYVY_reference;
  320.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_YUYV] = VDPixmapBlt_Y8_to_YUYV_reference;
  321.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_Y8] = VDPixmapBlt_UYVY_to_Y8_reference;
  322.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_Y8] = VDPixmapBlt_YUYV_to_Y8_reference;
  323.  
  324.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_XRGB1555] = VDPixmapBlt_UYVY_to_XRGB1555_reference;
  325.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_RGB565  ] = VDPixmapBlt_UYVY_to_RGB565_reference;
  326.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_RGB888  ] = VDPixmapBlt_UYVY_to_RGB888_reference;
  327.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_XRGB8888] = VDPixmapBlt_UYVY_to_XRGB8888_reference;
  328.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_XRGB1555] = VDPixmapBlt_YUYV_to_XRGB1555_reference;
  329.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_RGB565  ] = VDPixmapBlt_YUYV_to_RGB565_reference;
  330.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_RGB888  ] = VDPixmapBlt_YUYV_to_RGB888_reference;
  331.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_XRGB8888] = VDPixmapBlt_YUYV_to_XRGB8888_reference;
  332.     sReferenceMap[kPixFormat_Y8][kPixFormat_XRGB1555] = VDPixmapBlt_Y8_to_XRGB1555_reference;
  333.     sReferenceMap[kPixFormat_Y8][kPixFormat_RGB565  ] = VDPixmapBlt_Y8_to_RGB565_reference;
  334.     sReferenceMap[kPixFormat_Y8][kPixFormat_RGB888  ] = VDPixmapBlt_Y8_to_RGB888_reference;
  335.     sReferenceMap[kPixFormat_Y8][kPixFormat_XRGB8888] = VDPixmapBlt_Y8_to_XRGB8888_reference;
  336.  
  337.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV444_XVYU] = VDPixmapBlt_XRGB1555_to_XVYU_reference;
  338.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV444_XVYU] = VDPixmapBlt_RGB565_to_XVYU_reference;
  339.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV444_XVYU] = VDPixmapBlt_RGB888_to_XVYU_reference;
  340.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV444_XVYU] = VDPixmapBlt_XRGB8888_to_XVYU_reference;
  341.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_Y8] = VDPixmapBlt_XRGB1555_to_Y8_reference;
  342.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_Y8] = VDPixmapBlt_RGB565_to_Y8_reference;
  343.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_Y8] = VDPixmapBlt_RGB888_to_Y8_reference;
  344.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_Y8] = VDPixmapBlt_XRGB8888_to_Y8_reference;
  345.  
  346. #if 0
  347.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YV12_to_XRGB1555_reference;
  348.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YV12_to_RGB565_reference;
  349.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YV12_to_RGB888_reference;
  350.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YV12_to_XRGB8888_reference;
  351.  
  352.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUV411_to_XRGB1555_reference;
  353.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUV411_to_RGB565_reference;
  354.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUV411_to_RGB888_reference;
  355.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUV411_to_XRGB8888_reference;
  356. #else
  357.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  358.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  359.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  360.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  361.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  362.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  363.  
  364.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  365.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  366.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  367.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  368.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  369.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  370.  
  371.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  372.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  373.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  374.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  375.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  376.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  377.  
  378.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  379.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  380.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  381.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  382.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  383.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  384.  
  385.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_XRGB1555] = VDPixmapBlt_YUVPlanar_decode_reference;
  386.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_RGB565  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  387.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_RGB888  ] = VDPixmapBlt_YUVPlanar_decode_reference;
  388.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_XRGB8888] = VDPixmapBlt_YUVPlanar_decode_reference;
  389.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_UYVY] = VDPixmapBlt_YUVPlanar_decode_reference;
  390.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_YUYV] = VDPixmapBlt_YUVPlanar_decode_reference;
  391. #endif
  392.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUV411_to_YV12_reference;
  393.  
  394.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV422_YUYV] = VDPixmapBlt_UYVY_to_YUYV_reference;
  395.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV422_UYVY] = VDPixmapBlt_UYVY_to_YUYV_reference;        // not an error -- same routine
  396.  
  397.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  398.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  399.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  400.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  401.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  402.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  403.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  404.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  405.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  406.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  407.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  408.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  409.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  410.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  411.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  412.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  413.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  414.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  415.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  416.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  417.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  418.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  419.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  420.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  421.     sReferenceMap[kPixFormat_XRGB1555][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  422.     sReferenceMap[kPixFormat_RGB565  ][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  423.     sReferenceMap[kPixFormat_RGB888  ][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  424.     sReferenceMap[kPixFormat_XRGB8888][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  425.     sReferenceMap[kPixFormat_YUV422_UYVY][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  426.     sReferenceMap[kPixFormat_YUV422_YUYV][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_encode_reference;
  427.  
  428.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  429.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  430.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  431.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  432.     sReferenceMap[kPixFormat_YUV444_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  433.  
  434.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  435.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  436.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  437.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  438.     sReferenceMap[kPixFormat_YUV422_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  439.  
  440.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  441.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  442.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  443.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  444.     sReferenceMap[kPixFormat_YUV420_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  445.  
  446.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  447.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  448.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  449.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  450.     sReferenceMap[kPixFormat_YUV411_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  451.  
  452.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  453.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  454.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  455.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  456.     sReferenceMap[kPixFormat_YUV410_Planar][kPixFormat_Y8           ] = VDPixmapBlt_YUVPlanar_convert_reference;
  457.  
  458.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV444_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  459.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV422_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  460.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV420_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  461.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV411_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  462.     sReferenceMap[kPixFormat_Y8][kPixFormat_YUV410_Planar] = VDPixmapBlt_YUVPlanar_convert_reference;
  463.  
  464.     return sReferenceMap;
  465. }
  466.